#include "bOS/bOS.h"

#include "Recipient.h"
using namespace mail;

Recipient::Recipient() 
{ 
	m_pcEmail = NULL;
}

Recipient& Recipient::operator=(const Recipient& src)
{
	if (&src != this)
	{
		if (m_pcEmail)
			delete [] m_pcEmail;
		int s = strlen(src.m_pcEmail);
		m_pcEmail = new char[s+1];
		strcpy(m_pcEmail, src.m_pcEmail);
	}
	return (*this);
}

Recipient::~Recipient()
{
	if (m_pcEmail)
		delete [] m_pcEmail;
}

char* Recipient::GetEmail()
{
	return m_pcEmail;
}

void Recipient::SetEmail(const char email[])
{
	assert(email);
	int s=strlen(email);
	if (s > 0)
	{
		m_pcEmail = new char[s+1];
		strcpy(m_pcEmail, email);
	}        
}